<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <input type="text" v-model.number.trim.lazy="txt">
        <!-- number 将text转换为number类型  trim 去掉前后空格   lazy 当input框失去焦点时，才响应 -->
        <h3>{{txt}}</h3>
    </div>

    <script src="../lib/Vue/vue.js"></script>
    <script>

        var vm = new Vue({
            el: '#app',
            data: {
                txt: ''
            },
        })
    </script>
</body>
</html>